<template>
	<view style="padding:0upx 30upx;">
		<view v-for="(item,id) in project" :key='id' @click="toarticlexq(item.id)" style="background-color: #fff;height: 200upx;box-shadow: 2upx 2upx 10upx #ccc;margin-top: 30upx;border-radius: 20upx;">
			<view style="text-align: left;margin-left: 30upx;">
				发布时间:<text style="color: #f00;">{{item.time}}</text>
			</view>
			<view style="width: 90%;margin-left: 5%;height: 80upx;overflow: hidden;line-height: 80upx;text-overflow: ellipsis;white-space: nowrap;">
				{{item.title}}
			</view>
				<view style="text-align: right;margin-right: 50upx;">
					所需通证值:<text style="color: #f00;">{{item.tzz}}</text>
				</view>
		</view>
	</view>
</template>

<script>
	export default {
	  data() {
	   return {
	    project:[],
	   }
	  },
	  onLoad() {
	    uni.getStorage({
	    	key: 'openid',
	    	success: (res) => {
	    		this.openid = res.data
	    		this.getarticle()
	    	},
	    	fail: () => {
	    		uni.navigateTo({
	    			url: '../login/login'
	    		});
	    	}
	    });
	  },
	  methods: {
			getarticle() {
				uni.request({
					url: this.$BASE_URL+'/index.php?i=2&c=entry&m=ewei_shopv2&do=mobile&r=tzz&app=1',
					method: 'POST',
					data: {'openid':this.openid},
					header:{'Content-Type':'application/x-www-form-urlencoded'},
					success:(res) => {
						console.log(res)
						this.project = res.data.project
					},
					fail: () => {},
					complete: () => {}
				});
			},
			toarticlexq(id){
				// console.log(id)
				uni.navigateTo({
					url:'articlexq?id=' + id
				})
			},
	  }
	 }
</script>

<style>
</style>
